package com.usian.admin.job;

import com.usian.admin.feign.WemediaFeign;
import com.usian.admin.service.WemediaNewsAutoScanService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

public class WeMediaNewsAutoScanJob {
    @Autowired
    private WemediaFeign wemediaFeign;
    @Autowired
    private WemediaNewsAutoScanService wemediaNewsAutoScanService;


    @XxlJob("wemediaAutoScanJob")
    public ReturnT<String> myJob(String param){

        //1:查询待发布列表 远程
        List<Integer> newsList = wemediaFeign.findNews();

        //2: 遍历 修改审核状态 8--9
        for(Integer newsId :newsList){
            wemediaNewsAutoScanService.newsAutoScan(newsId);
        }
        return  ReturnT.SUCCESS;
    }
}

